package model;

import java.awt.Point;

/** Class represents vertex in graph */
public class Vertex {
	
	/** Vertex id */
	private int id;
	
	/** Vertex location */
	private Point location;
	
	/** Vertex color */
	private int color;
	
	/** Vertex degree */
	private int degree;
	
	/** (only for drawing) physical location on screen */
	private int physicalX, physicalY;
	
	
	/** Constructor 
	 * 
	 * @param id Identifier
	 * @param x x location
	 * @param y y location
	 */
	public Vertex (int id, double x, double y) {
		this.id = id;
		this.location = new Point();
		this.location.setLocation(x, y);
		this.degree = 0; // do not know degrees yet
		this.color = -1; // graph is not colored
		this.physicalX = -1;
		this.physicalY = -1;
	}

	/********** GETTERS AND SETTERS ************/
	
	/** Method returns vertex identifier
	 * @return vertex identifier
	 */
	public int getId() {
		return id;
	}

	/** Method sets vertex identifier
	 * 
	 * @param id vertex identifier
	 */
	public void setId(int id) {
		this.id = id;
	}

	/** Method returns vertex location
	 * @return vertex location
	 */
	public Point getLocation() {
		return location;
	}
	
	/** Method returns vertex color
	 * @return vertex color
	 */
	public int getColor() {
		return color;
	}

	/** Method sets vertex color
	 * 
	 * @param color vertex color
	 */
	public void setColor(int color) {
		this.color = color;
	}

	/** Method returns vertex degree
	 * @return vertex degree
	 */
	public int getDegree() {
		return degree;
	}

	/** Method sets vertex degree
	 * 
	 * @param degree vertex degree
	 */
	public void setDegree(int degree) {
		this.degree = degree;
	}

	/** Method returns vertex physical X
	 * 
	 * @return Physical x
	 */
	public int getPhysicalX() {
		return physicalX;
	}

	/** Method returns vertex physical Y
	 * 
	 * @return Physical y
	 */
	public int getPhysicalY() {
		return physicalY;
	}

	/** Method sets vertex physical X
	 * 
	 * @return Physical X
	 */
	public void setPhysicalX(int physicalX) {
		this.physicalX = physicalX;
	}

	/** Method sets vertex physical Y
	 * 
	 * @return Physical Y
	 */
	public void setPhysicalY(int physicalY) {
		this.physicalY = physicalY;
	}
}
